<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * Description of mod_Search
 * 
 * @author Subha Sundar Das (subhasundar.das@gmail.com)
 */
class mod_Search extends CI_Model {

    //put your code here

    function __construct() {
        parent::__construct();
        log_message('debug', 'Model Initialized');
    }

//-- Get new Car list by Budget and Make -----//    
    function get_new_car($budget_from=0, $budget_to=0, $make=null) {
        if ($make) {
            $sql = "Select * from CAR_MASTER where MAKE=$make and PRICE >=$budget_from and PRICE <=$budget_to and status=51 order by PRICE";
            $query = $this->db->query($sql);
            $result = $query->result();
            return $result;
        } else {
            $sql = "Select * from CAR_MASTER where PRICE >=$budget_from and PRICE <=$budget_to and status=51 order by PRICE";
            $query = $this->db->query($sql);
            $result = $query->result();
            return $result;
        }
    }
    

    
    
    
    
    
}

?>
